cmake_minimum_required(VERSION 3.21)

set(CMAKE_CXX_STANDARD 11) # C++17标准
set(CMAKE_CUDA_COMPILER /usr/local/cuda-12.2/bin/nvcc)
set(CUDACXX /usr/local/cuda-12.2/bin/nvcc)

project(cuda01 LANGUAGES CXX CUDA)

if(CUDA_ENABLE)
    enable_language(CUDA)
endif()

#find_package(CUDA REQUIRED)

#find_package(CUDAToolkit REQUIRED)

aux_source_directory(. SRC)

add_library(${PROJECT_NAME} SHARED)

target_sources(${PROJECT_NAME}
        PRIVATE ${SRC}
        PUBLIC include/matrix.h
)

# set(CUDA_INCLUDE_DIR "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2/include")

include_directories(${PROJECT_NAME}
        PUBLIC include/
        ${CUDA_INCLUDE_DIR}
)

set_target_properties(${PROJECT_NAME} PROPERTIES
        CUDA_SEPARABLE_COMPILATION ON)

#add_executable(${PROJECT_NAME} ${SRC})
#
#target_include_directories(${PROJECT_NAME}
#
#        )

# cmake -B build -G ""
# cmake --build build